<section>
  <div class="layout clearfix">
    <div class="productSort">
      <dl class="clearfix layout bgWhite shadow">
        <dt class="fl">积分商城</dt>
        <dd class="fl">
          > 积分专区
          <!--
          <ul class="fl productSortType">
            <li class="sortLi">
              <a class="typeLink" data-iscleck="-1" href="javascript:;">积分专区<i></i></a>
              <ul class="childNav saleStatus">
                <li><a href="/shop#">积分专区</a></li>
                <li><a href="/repeats">复消专区</a></li>
              </ul>
            </li>
          </ul>
          -->
        </dd>
        <dd class="fr" id="chartList" amount="{{datalist.length}}">
          <ul class="fl productSortType">
            <li class="sortLi" data-step="3" data-intro="添加完毕点击下面的购物车完成付款" data-position="top">
              <a id="cartCount" class="typeLink" data-iscleck="-1"
                 href="#!/transaction/center/cart">购物车&nbsp;(<span>{{purchase.length||0}}</span>)<i></i>
              </a>
            </li>
          </ul>
        </dd>
      </dl>
    </div>
    <!-- 排序区 end -->
    <!-- 左侧辅助信息 start -->
    <aside class="fl column">
      <dl class="financialData mb20" style="margin-top: 10px;">
        <dt class="bgBlue"><i class="icon"></i>可用积分</dt>
        <dd class="bgWhite introjs-showElement introjs-relativePosition" data-step="1"
            data-intro="购买产品只能使用下列的积分" data-position="top">
          <ul>
            <li>电子积分 <em>{{points.cpElecPoint||0}}</em> 元</li>
          </ul>
        </dd>
      </dl>
      <!-- 常见问题 start -->
      <dl class=" mb20" style="background-color: #fff;">
        <dt class="bgYellow">常见问题<a ui-sref="help.about" target="_blank"
                                    style="float: right;color: #fff;font-size: 14px;">更多&gt;</a>
        </dt>
        <dd class="questionList">
          <ul>
            <li style="position: relative"><a class="link666" href="#!/help/faq#1" target="_blank">如何获得电子积分？<i
              class="icon hot"></i></a></li>
            <!--<li><a class="link666" href="#!/help/faq#2" target="_blank">关于复消积分的问题？
            <i class="icon new"></i></a></li>-->
            <li><a class="link666" href="#!/help/faq#3" target="_blank">如何购买商品？</a></li>
            <li><a class="link666" href="#!/help/faq#4" target="_blank">如何修改电子钱包账户？</a></li>
            <li><a class="link666" href="#!/help/faq#5" target="_blank">我购买了商品多长时间发货？</a></li>
          </ul>
        </dd>
      </dl>
      <!-- 常见问题 end -->
    </aside>
    <!-- 左侧辅助信息 end -->
    <article class="fr sidebar productList fc666">
      <!-- 商品列表 start-->
      <div class="product youxuan " ng-repeat="obj in datalist">
        <!--<ul class="pList fl">-->
        <!--<li class="bgWhite" ng-repeat="obj in datalist">-->
        <div class="bgWhite shadow mb10" style="width: 33%;height: 360px;float: left">
          <div>
            <a href="javascript:void(0);">
              <img src="./images/shop/{{obj.glPic}}"
                   style="width:280px;height:280px;padding:5px 0px;display: block;margin: auto;" alt="">
            </a>
          </div>
          <div style="padding: 2px 10px">
            <p>{{obj.glName}}</p>
          </div>
          <div class="fl">
            <p class="priceRed">￥<span>{{obj.glPrice}}</span></p>
          </div>
          <div class="fr">
            <button type="button" class="buyCart" data-tid="{{obj.tid}}" onclick="addCart(this)">加入购物车</button>
          </div>
        </div>
        <!--</li>-->
        <!--</ul>-->
      </div>
      <!-- 商品列表 end-->
    </article>
  </div>
</section>
<!--[if IE 6]>
<![endif]-->
<script type="text/javascript">

  function addCart(e) {
    var id = $(e).attr('data-tid');
    $('body').mLoading('show');

    var investing = false;
    $.ajax({
      type: "post",
      url: 'goods/checkInvest',
      data: {},
      async: false,
      success: function (result) {
        if (result.retCode == '1') {
          investing = result.data.investing;
        }
      }
    });

    if (investing) {
      $('body').mLoading('hide');
      confirm('存在投资中项目，不可重复投资，确认购买？', function () {
        addChartPost(id);
      }, function () {
        $('body').mLoading('hide');
      })
    } else {
      addChartPost(id)
    }
  }

  function addChartPost(id) {
    $.ajax({
      url: 'goods/addChart',
      type: 'post',
      data: {
        goodsid: id
      },
      success: function (json) {
        if (json.retCode == '1') {
          $('body').mLoading('hide');
          success("已成功将商品添加到购物车", function () {
          })
        } else {
          error(json.retMsg, function () {
          })
        }
        $('body').mLoading('hide');
      }
    });
  }

</script>
<div id="cxdialog" class="cxdialog"></div>
<div id="cxdialog_overlay" class="cxdialog_overlay"></div>
<a href="javascript:;" rel="nofollow" class="backToTop" style="display: none;"></a>

